package com.colter.project.data.structure.sort;

import java.util.Arrays;
import java.util.Random;

public class SortTest {
	public static void main(String[] args) {
//		int[] arr = new int[] { 8, 5, 7, 5,6,5};
		int[] arr = new int[15];
		Random random = new Random();
		for (int i = 0; i < arr.length; i++) {
			arr[i] = random.nextInt(100);
		}
		
		
		
		
		int[] nums = Arrays.copyOf(arr, arr.length);
		MergeSort.sort(nums, 0, nums.length - 1);
		System.out.println(Arrays.toString(nums) + " merge sort");

		int[] nums2 = Arrays.copyOf(arr, arr.length);
		BubbleSort.sort(nums2);
		System.out.println(Arrays.toString(nums2) + " bubble sort");

		int[] nums3 = Arrays.copyOf(arr, arr.length);
		SelectionSort.sort(nums3);
		System.out.println(Arrays.toString(nums3) + " selection sort");

		int[] nums4 = Arrays.copyOf(arr, arr.length);
		int[] result = InsertionSort.sort(nums4);
		System.out.println(Arrays.toString(result) + " Insertion sort");

		int[] nums5 = Arrays.copyOf(arr, arr.length);
		RadixSort.sort(nums5, 3);
		System.out.println(Arrays.toString(nums5) + " Radix sort");

		int[] nums6 = Arrays.copyOf(arr, arr.length);
		int[] result2 = CountingSort.sort(nums6);
		System.out.println(Arrays.toString(result2) + " Counting sort");
		
		int[] nums7 = Arrays.copyOf(arr, arr.length);
		QuickSort.sort(nums7);
		System.out.println(Arrays.toString(nums7) + " Quick sort");


		System.out.println(Arrays.toString(arr));

	}
}
